<template>
	<view style="background-color: #fff; padding-bottom: 180rpx;">
    <u-sticky>
      <view class="container" style="padding: 0rpx; margin-bottom: 60rpx;">
        <!-- #ifdef H5 -->
        <video class="video-h" style="object-fit:cover; width: 100%; height: 360rpx;" :poster="newsDetail.coverPath ? newsDetail.coverPath : ''" controls width="100%" :src="newsDetail.details"></video>
        <!-- #endif -->
        <!-- #ifdef APP-PLUS -->
        <video class="video-h" style="object-fit:cover; width: 100%; height: 360rpx;" :poster="newsDetail.coverPath ? newsDetail.coverPath : ''" controls width="100%" :src="newsDetail.details"></video>
        <!-- #endif -->
        <!-- #ifdef MP-WEIXIN -->
        <video class="video-h" objectFit="cover" style="width: 100%; height: 360rpx;" :poster="newsDetail.coverPath ? newsDetail.coverPath : ''" controls width="100%" :src="newsDetail.details"></video>
        <!--  #endif -->
      </view>
    </u-sticky>
		
		<!-- 评价 -->
		<view class="container">
			<newsComment ref="newsComment" :id="informationId" @applyBottomFn="isNoBottomFn"></newsComment>
		</view>
	</view>
</template>

<script>
	import newsComment from "./comment/newsComment.vue"; //评论区
	import { API } from '@/config/myApi.js';
	export default {
		data() {
			return {
				newsDetail: {},
				newsCommentList: [],
        informationId: "",
        // 判断 上拉 刷新的是评价、还是 回复
        isBack: false,
			};
		},
		components: {
			newsComment,
		},
		onLoad(option) {
      this.informationId = option.id;
      this.getInformationDetail(this.informationId);
		},
    // 上拉加载 加载 组件的列表请求
    onReachBottom() {
      console.log(this.isBack);
      this.$refs.newsComment.listOnBottomFn();
    },
		methods:{
			getInformationDetail(id){
				API.getInfoDetail(id).then(res=>{
					if(res.code===200){
						this.newsDetail = res.result;
					}
				})
			},
      isNoBottomFn(data) {
        this.isBack = data;
      }
		}
	}
</script>

<style lang="scss" scoped>

</style>
